using System.ComponentModel.DataAnnotations;

namespace S.M.SmartMedical.Domain.DTOs
{
    /// <summary>
    /// 医院DTO数据传输对象
    /// 用于API响应和前端数据交互
    /// </summary>
    public class HospitalDto
    {
        /// <summary>
        /// 医院ID
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// 医院名称
        /// </summary>
        public string Name { get; set; } = string.Empty;

        /// <summary>
        /// 医院图片URL
        /// </summary>
        public string ImageUrl { get; set; } = string.Empty;

        /// <summary>
        /// 医院等级
        /// </summary>
        public string Level { get; set; } = string.Empty;

        /// <summary>
        /// 医院类型
        /// </summary>
        public string Type { get; set; } = string.Empty;

        /// <summary>
        /// 医院地址
        /// </summary>
        public string Address { get; set; } = string.Empty;

        /// <summary>
        /// 联系电话
        /// </summary>
        public string Phone { get; set; } = string.Empty;

        /// <summary>
        /// 医院描述
        /// </summary>
        public string Description { get; set; } = string.Empty;

        /// <summary>
        /// 是否启用
        /// </summary>
        public bool IsEnabled { get; set; } = true;

        /// <summary>
        /// 上传人
        /// </summary>
        public string Uploader { get; set; } = string.Empty;

        /// <summary>
        /// 上传时间
        /// </summary>
        public DateTime UploadTime { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime UpdateTime { get; set; }
    }

    /// <summary>
    /// 医院搜索参数DTO
    /// </summary>
    public class HospitalSearchParamsDto
    {
        /// <summary>
        /// 医院名称关键字
        /// </summary>
        public string? Name { get; set; }

        /// <summary>
        /// 医院等级
        /// </summary>
        public string? Level { get; set; }

        /// <summary>
        /// 医院类型
        /// </summary>
        public string? Type { get; set; }

        /// <summary>
        /// 当前页码
        /// </summary>
        public int CurrentPage { get; set; } = 1;

        /// <summary>
        /// 每页记录数
        /// </summary>
        public int PageSize { get; set; } = 10;
    }

    /// <summary>
    /// 医院创建DTO
    /// </summary>
    public class HospitalCreateDto
    {
        /// <summary>
        /// 医院名称
        /// </summary>
        [Required(ErrorMessage = "医院名称不能为空")]
        [MaxLength(100, ErrorMessage = "医院名称长度不能超过100字符")]
        public string Name { get; set; } = string.Empty;

        /// <summary>
        /// 医院图片URL
        /// </summary>
        [MaxLength(500, ErrorMessage = "图片URL长度不能超过500字符")]
        public string ImageUrl { get; set; } = string.Empty;

        /// <summary>
        /// 医院等级
        /// </summary>
        [Required(ErrorMessage = "医院等级不能为空")]
        [MaxLength(20, ErrorMessage = "医院等级长度不能超过20字符")]
        public string Level { get; set; } = string.Empty;

        /// <summary>
        /// 医院类型
        /// </summary>
        [Required(ErrorMessage = "医院类型不能为空")]
        [MaxLength(20, ErrorMessage = "医院类型长度不能超过20字符")]
        public string Type { get; set; } = string.Empty;

        /// <summary>
        /// 医院地址
        /// </summary>
        [Required(ErrorMessage = "医院地址不能为空")]
        [MaxLength(200, ErrorMessage = "医院地址长度不能超过200字符")]
        public string Address { get; set; } = string.Empty;

        /// <summary>
        /// 联系电话
        /// </summary>
        [Required(ErrorMessage = "联系电话不能为空")]
        [MaxLength(50, ErrorMessage = "联系电话长度不能超过50字符")]
        public string Phone { get; set; } = string.Empty;

        /// <summary>
        /// 医院描述
        /// </summary>
        [MaxLength(1000, ErrorMessage = "医院描述长度不能超过1000字符")]
        public string Description { get; set; } = string.Empty;

        /// <summary>
        /// 是否启用
        /// </summary>
        public bool IsEnabled { get; set; } = true;
    }

    /// <summary>
    /// 医院更新DTO
    /// </summary>
    public class HospitalUpdateDto : HospitalCreateDto
    {
        /// <summary>
        /// 医院ID
        /// </summary>
        [Required(ErrorMessage = "医院ID不能为空")]
        public int Id { get; set; }
    }
}